(function() {

var scripts = document.getElementsByTagName('script');
var script = scripts[scripts.length-1];
var baseUrl = script.src.split('/').slice(0, -2).join('/');
var bookmarkletUrl = baseUrl + '/js/socialdashboard-bootstrap.js';

var div = document.createElement('div');
var isIE = !!window.ActiveXObject;
var isIE6 = isIE && typeof document.body.style.maxHeight == "undefined";
div.className = 'osd-btn-bootstrap';
div.style.position = isIE6 ? 'absolute' : 'fixed';
div.onclick = function() {
  (function(d,u,s) {
    s = d.createElement('script');
    s.type = 'text/javascript';
    s.src = u;
    d.body.appendChild(s);
  })(document, bookmarkletUrl)
}

var addEventListener = 
window.addEventListener ? function(event, fn) {
  window.addEventListener(event, fn, false);
} : window.attachEvent ? function(event, fn) {
  window.attachEvent('on'+event, fn);
} : function(event, fn) {
  var _fn = window['on'+event];
  window['on'+event] = function() {
    if (_fn) _fn.apply(this, arguments);
    return fn.apply(this, arguments);
  }
}
addEventListener('load', function() {
  document.body.appendChild(div);
})

})()
